import React from 'react';
import PropTypes from 'prop-types';
import CommonEnums from '@/enums';

import './index.less';

type Props = {
  showLoading?: boolean;
};

const ShowLoading: React.FC<Props> = (props) => {
  return (
    <div>
      {props.showLoading ? (
        <div id={CommonEnums.LOADING_ID} className="loading-info">
          loading
        </div>
      ) : (
        <div className="loading-info">没有数据了~</div>
      )}
    </div>
  );
};

ShowLoading.defaultProps = {
  showLoading: true,
};

ShowLoading.propTypes = {
  showLoading: PropTypes.bool,
};

export default ShowLoading;
